package com.hirsi.common.core.validator;

import cn.hutool.core.lang.Validator;
import com.hirsi.common.core.validator.annotation.Phone;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * 手机号码验证实现
 * @author 封夕
 * @since 2023/6/7 17:28
 */
public class PhoneValidator implements ConstraintValidator<Phone, String> {
    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
        return Validator.isMobile(s);
    }
}
